Skip to content

fix(@angular/cli): ignore system files in service worker - #7340

Closed
cyrilletuzi wants to merge 2 commits into
angular:masterfrom
cyrilletuzi:patch-6
Closed

fix(@angular/cli): ignore system files in service worker#7340
cyrilletuzi wants to merge 2 commits into
angular:masterfrom
cyrilletuzi:patch-6

Conversation

@cyrilletuzi

Copy link
Copy Markdown
Contributor

Related to angular/mobile-toolkit#180

When copying the assets, the CLI includes system files (e.g. .DS_Store and Thumbs.db). As a consequence, they are included in the service worker manifest as files to cache. But such file may (and should) not be deployed to the server, then a file will be missing, then the service worker installation will fail and so all the offline feature won't work.

This PR makes the CLI ensure the service worker will ignore these system files.

Related to angular/mobile-toolkit#180

When copying the assets, the CLI includes system files (e.g. .DS_Store and Thumbs.db). As a consequence, they are included in the service worker manifest as files to cache. But such file may (and should) not be deployed to the server, then a file will be missing, then the service worker installation will fail and so all the offline feature won't work.

This PR makes the CLI ensure the service worker will ignore these system files.
@intellix

intellix commented Aug 11, 2017

Copy link
Copy Markdown
Contributor

Maybe ignore all files that begin with a dot? Not sure what else there would be but I don't think any of them should be included ever :)

@cyrilletuzi

cyrilletuzi commented Aug 11, 2017

Copy link
Copy Markdown
Contributor Author

I'm not sure the angular/service-worker API permits to remove patterns from the ignore field, so it may be not a good idea to include too much things, as special user cases could be blocked.

And as we are in the CLI, it's the CLI itself who chooses which files will be generated, so there should be no risk for other files.

@filipesilva

Copy link
Copy Markdown
Contributor

@alxhub can you have a look please?

@cyrilletuzi

Copy link
Copy Markdown
Contributor Author

Will this be part of the finalization of service-worker in Angular 5 and CLI complete automation of PWA ?

@playground

Copy link
Copy Markdown

Can we also have the capability to exclude certain files from the build?
For example:

"static.ignore": [
"/assets/",
"**/
.map"
]

@cyrilletuzi

Copy link
Copy Markdown
Contributor Author

Closed in favor of angular/devkit#263

@cyrilletuzi cyrilletuzi closed this Nov 7, 2017
@cyrilletuzi
cyrilletuzi deleted the patch-6 branch November 7, 2017 19:52
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants